package com.hspedu.enum_;

/**
 * @Author Stringzhua
 * @Date 2024/3/6 20:14
 * description:
 */
public class Enumeration01 {
    public static void main(String[] args) {
        //使用
        Season01 spring = new Season01("春天", "温暖");
        Season01 winter = new Season01("冬天", "寒冷");
        Season01 summer = new Season01("夏天", "炎热");
        Season01 autumn = new Season01("秋天", "凉爽");
        autumn.setName("xxxx");
        autumn.setDesc("非常的热");
        //因为对于季节而言,它的对象(具体值),是固定的四个,不会有更多
        //按这种设计类的思路,不能体现季节是固定的四个季节
        //因此,这样的设计不好---->因此,出现了枚举类型[枚:一个一个 举:列举
        // 即把具体的对象一个一个的列举出来的类就称为枚举类]
        Season01 other = new Season01("红天", "----");
    }
}

class Season01 {//类
    private String name;//季节
    private String desc;//描述

    public Season01(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
